// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 密码认证登录 POST /shop/auth/login */
export async function login2(
  body: API.ShopLoginDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseAuthToken>(`/barter-user/shop/auth/login`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 完善信息 POST /shop/auth/perfect */
export async function perfect(
  body: API.ShopPerfectDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/shop/auth/perfect`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /shop/auth/register */
export async function register(
  body: API.ShopRegisterDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/shop/auth/register`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 手机号认证登录（短信暂未接入） POST /shop/auth/sms/login */
export async function smsLogin(
  body: API.ShopSmsLoginDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseAuthToken>(
    `/barter-user/shop/auth/sms/login`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 获取登录用户信息 GET /shop/auth/userInfo */
export async function userInfo2(options?: { [key: string]: any }) {
  return request<API.BaseResponseShopAccountVo>(
    `/barter-user/shop/auth/userInfo`,
    {
      method: "GET",
      ...(options || {}),
    }
  );
}
